﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T06
{
    class Program
    {
        static void Main(string[] args)
        {
            double a = 10.23f;//隐士转换
            Console.WriteLine($"{a}");
            int b = (int)a;//显示转换
            Console.WriteLine($"强制类型转换{b}");
            Console.WriteLine("********************");
            //字符串与数值转换
            string s = "123";
            int ic = int.Parse(s);//也可以用Int32
            Console.WriteLine("字符串转换成整形{0}",ic);
            //int id = int.Parse("123s");
             int _id;
            bool bd = int.TryParse("123s", out _id);//尝试分析
            Console.WriteLine("{0}",bd);
            //转换类
            int ie = Convert.ToInt32("123");
            Console.WriteLine($"conver转换字符串{ie}");
            //字符转换字符串
            Console.WriteLine($"数值类型转换{12.ToString()}");

            Console.ReadKey();
        }
    }
}
